<?php
class Areal_Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{

    protected function _initAutoload()
    {
        $autoloader = new Zend_Application_Module_Autoloader(array(
            'namespace' => 'Default_',
            'basePath'  => APPLICATION_PATH . 'modules/default',
        ));
        return $autoloader;
    }

    protected function  _initNavigation()
    {

        $config = new Zend_Config_Xml(APPLICATION_PATH . 'menu.xml');
        $navigation = new Zend_Navigation($config);
        $page = $navigation->findOneBy('label', 'Catalog');
        $this->bootstrap('view');        
        $view = $this->getPluginResource('view')->getView();
        $view->getHelper('navigation')->navigation($navigation);

        //$acl = Zend_Registry::get('Areal_Acl');
        //$view = Zend_Layout::getMvcInstance()->getView();
        //$role_id = Zend_Auth::getInstance()->getIdentity()->getRoleId();
        //$helper = $view->getHelper('Navigation');
        //$helper->setAcl($acl)->setRole($role_id);
        //Zend_Registry::set('Zend_Navigation', $navigation);

        return $navigation;
    }

}
